import neu.soft.App;
import neu.soft.entity.User;
import neu.soft.mapper.UserMapper;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import java.util.List;

@RunWith(SpringRunner.class)
@SpringBootTest(classes = App.class)
public class test01 {
    @Autowired
    UserMapper userMapper;
    @Test
    public void testUserFindAll(){
       List<User>userList = userMapper.findAll();
        userList.forEach(System.out::println);
    }

    @Test
    public void testUseradd(){
        User user =new User();
        user.setLoc("山西省大同市云州区");
        user.setTele("165-7896-5478");
        user.setUsername("zhangxiaoming");
      userMapper.add(user);

    }
}
